package GUI;
import Buildings.Buildings;
import Interfaces.*;
import Buildings.dwelling.*;
import Buildings.office.*;
import javax.swing.*;
import java.awt.Component.*;
import java.awt.*;
public class SpaceButton extends JButton {
    private Space s;
    private int num;
    private BFrame bf;
    private void MouseClicked(java.awt.event.MouseEvent evt) {                                      
        bf.labelSpaceArea.setText("Общая площадь: "+s.getHowMuchArea());
        bf.labelSpaceNum.setText("Номер помещения: "+num);
        bf.labelSpaceRoom.setText("Количество комнат: "+s.getHowMuchArea());
    } 
    
    public SpaceButton(Space s,int num, BFrame bf){
        this.s=s;
        this.num=num;
        this.bf=bf;
        this.setText(Integer.toString(num));
        this.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                MouseClicked(evt);
            }
        });
    }
}
